<?php

function displayHeader(App $app) {
    ?>
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title><?php echo $app->getTitle(); ?> - iSearch</title>
            <link rel="stylesheet" href="css/bootstrap.min.css">
            <?php
            foreach ($app->getCss() as $css) {
                ?>
                <link rel="stylesheet" href="css/<?php echo $css; ?>">
                <?php
            }
            ?>
        </head>
        <body class="container">
            <nav class="navbar navbar-default" role="navigation">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only">Menu</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="index.php">iSearch</a>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <form class="navbar-form navbar-left" role="search" method="GET" action="index.php">
                            <div class="form-group">
                                <input type="text" name="q" class="form-control" placeholder="Rechercher ...">
                            </div>
                            <button type="submit" class="btn btn-primary">Go!</button>
                        </form>
                        <ul class="nav navbar-nav navbar-right">
                            <li>
                                <a href="exploration.php">Exploration</a>
                            </li>
                            <li>
                                <a href="indexation.php">Indexation</a>
                            </li>
                            <li>
                                <a href="evaluateur.php">Évaluateur</a>
                            </li>
                        </ul>
                    </div><!-- /.navbar-collapse -->
                </div><!-- /.container-fluid -->
            </nav>
            <h1><?php echo $app->getTitle(); ?></h1>
            <hr />
    <?php
}
